const { defineConfig } = require('@vue/cli-service');
const path=require("path");

module.exports = defineConfig({
	transpileDependencies: true,
	css:{
		sourceMap:true
    },
	devServer:{
		open:true,
		host:"localhost",
		// port:"8080",
		https:false,
		proxy:{
			"":{
				target:"http://1.13.248.197:8080/",
				changeOrigin:true,
				pathRewrite:{
					"^/qilin":""
				},
				logLevel:"debug" //打印请求日志
			}
		}
	},
	configureWebpack:{
        resolve:{
            alias:{
                "@":path.resolve(__dirname,"src"),
                "$scss":path.resolve(__dirname,"src/assets/scss")
            }
        }
    },
	chainWebpack:(config)=>{
        const oneOfsMap=config.module.rule("scss").oneOfs.store;
        oneOfsMap.forEach((item)=>{
            item
                .use("sass-resources-loader")
                .loader("sass-resources-loader")
                .options({
                    resources:"src/assets/scss/common.scss"
                })
                .end()
        });
    }
});
